﻿<Window x:Class="WPF_CM.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="542" Width="542">
    <Grid>
        <TabControl HorizontalAlignment="Center" Height="492" VerticalAlignment="Center" Width="512"  >
            <TabItem Header="User">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="11*"/>
                        <ColumnDefinition Width="491*"/>
                    </Grid.ColumnDefinitions>
                    <GroupBox Header="User" HorizontalAlignment="Center" Height="440" Margin="10" VerticalAlignment="Center" Width="482" Grid.ColumnSpan="2"></GroupBox>
                    <Label x:Name="lblEmpID" Content="Employee ID:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="19.657,40,0,390" Grid.Column="1"/>
                    <TextBox x:Name="txtEmpID" HorizontalAlignment="Left" Height="30" Margin="106.657,40,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <DataGrid x:Name="dgdUsers" HorizontalAlignment="Left" Height="108" Margin="20,332,0,0" VerticalAlignment="Top" Width="438" Grid.Column="1" Loaded="User_Loaded" SelectionChanged="dgdUsers_SelectionChanged"/>
                    <CheckBox x:Name="chbxUDisable" Content="Disable User" HorizontalAlignment="Left" Margin="106.657,276,0,0" VerticalAlignment="Top" Grid.Column="1"/>
                    <Button x:Name="btnAddUser" Content="Add User" HorizontalAlignment="Left" Margin="382.657,40,0,0" VerticalAlignment="Top" Height="30" Width="75" Click="btnAddUser_Click" Grid.Column="1"/>
                    <Button x:Name="btnSaveUser" Content="Save" HorizontalAlignment="Left" Margin="392.657,75,0,0" VerticalAlignment="Top" Height="30" Width="65" Grid.Column="1" Click="btnSaveUser_Click" />
                    <Button x:Name="btnDeleteUser" Content="Delete" HorizontalAlignment="Left" Margin="392.657,110,0,0" VerticalAlignment="Top" Height="30" Width="65" Grid.Column="1" Click="btnDeleteUser_Click"/>
                    <Button x:Name="btnUcancel" Content="Cancel" HorizontalAlignment="Left" Margin="392.657,145,0,0" VerticalAlignment="Top" Height="30" Width="65" Grid.Column="1"/>
                    <TextBox x:Name="txtUsearch" HorizontalAlignment="Left" Height="30" Margin="106.657,297,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblUsearch"  Content="Search All:" HorizontalAlignment="Left" Margin="19.657,297,0,0" VerticalAlignment="Top" Width="82" Grid.Column="1"/>
                    <Button x:Name="btnUsearch" Content="Search" HorizontalAlignment="Left" Margin="382.657,297,0,0" VerticalAlignment="Top" Height="30" Width="75" Grid.Column="1" Click="btnUsearch_Click" />
                    <Label x:Name="lblFirstName" Content="First Name:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="19.657,75,0,355" Grid.Column="1"/>
                    <TextBox x:Name="txtFirstName" HorizontalAlignment="Left" Height="30" Margin="106.657,75,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblLastName" Content="Last Name:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="19.657,110,0,320" Grid.Column="1"/>
                    <TextBox x:Name="txtLastName" HorizontalAlignment="Left" Height="30" Margin="106.657,110,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblUserName" Content="Username:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="19.657,145,0,285" Grid.Column="1"/>
                    <TextBox x:Name="txtUserName" HorizontalAlignment="Left" Height="30" Margin="106.657,145,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblPassword" Content="Password:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="19.657,180,0,250" Grid.Column="1"/>
                    <TextBox x:Name="txtPassword" HorizontalAlignment="Left" Height="30" Margin="106.657,180,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblGroups" Content="Groups:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="19.657,215,0,215" Grid.Column="1"/>
                    <TextBox x:Name="lbxGroups" HorizontalAlignment="Left" Height="56" Margin="106.657,215,0,0" VerticalAlignment="Top" Width="260" Grid.Column="1" />
                </Grid>
            </TabItem>

            <TabItem Header="Group">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="59*"/>
                        <ColumnDefinition Width="194*"/>
                    </Grid.ColumnDefinitions>
                    <GroupBox Header="Group" HorizontalAlignment="Center" Height="440" Margin="10" VerticalAlignment="Center" Width="482" Grid.ColumnSpan="2"/>
                    <Label x:Name="lblGroupID" Content="Group ID:" HorizontalAlignment="Left" Height="30" Margin="31,40,0,394"/>
                    <TextBox x:Name="txtGroupID" HorizontalAlignment="Left" Height="30" Margin="0,40,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <DataGrid x:Name="dgdGroups" HorizontalAlignment="Left" Height="107" Margin="31,332,0,0" VerticalAlignment="Top" Width="438" Grid.ColumnSpan="2" Loaded="Groups_Loaded" SelectionChanged="dgdGroups_SelectionChanged"/>
                    <CheckBox x:Name="chbxGDisable" Content="Disable Group" HorizontalAlignment="Left" Margin="0,276,0,0" VerticalAlignment="Top" Grid.Column="1"/>
                    <Button x:Name="btnAddGroup" Content="Add Group" HorizontalAlignment="Left" Margin="276,40,0,0" VerticalAlignment="Top" Height="30" Width="75" Click="btnAddGroup_Click" Grid.Column="1"/>
                    <Button x:Name="btnSaveGroup" Content="Save" HorizontalAlignment="Left" Margin="286,75,0,0" VerticalAlignment="Top" Height="30" Width="65" Grid.Column="1" />
                    <Button x:Name="btnDeleteGroup" Content="Delete" HorizontalAlignment="Left" Margin="287,110,0,0" VerticalAlignment="Top" Height="30" Width="65" Grid.Column="1"/>
                    <Button x:Name="btnGroupCancel" Content="Cancel" HorizontalAlignment="Left" Margin="286,145,0,0" VerticalAlignment="Top" Height="30" Width="65" Grid.Column="1"/>
                    <TextBox x:Name="txtGroupSearch" HorizontalAlignment="Left" Height="30" Margin="0,297,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblGroupSearch"  Content="Search All:" HorizontalAlignment="Left" Margin="31,301,0,0" VerticalAlignment="Top" Width="82"/>
                    <Button x:Name="btnGroupsearch" Content="Search" HorizontalAlignment="Left" Margin="276,297,0,0" VerticalAlignment="Top" Height="30" Width="75" Grid.Column="1" Click="btnGroupsearch_Click" />
                    <Label x:Name="lblGroupName" Content="Name:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="31,77,0,357"/>
                    <TextBox x:Name="txtGroupName" HorizontalAlignment="Left" Height="30" Margin="0,75,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblGroupPriority" Content="Priority:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="31,112,0,322"/>
                    <TextBox x:Name="txtGroupPriority" HorizontalAlignment="Left" Height="30" Margin="0,110,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblGroupDescription" Content="Description:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="31,147,0,287"/>
                    <TextBox x:Name="txtGroupDescription" HorizontalAlignment="Left" Height="30" Margin="0,145,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblSubGroupOf" Content="Child Of:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="31,182,0,252"/>
                    <TextBox x:Name="txtSubGroupOf" HorizontalAlignment="Left" Height="30" Margin="0,180,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                    <Label x:Name="lblAttributes" Content="Attributes:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="31,217,0,217"/>
                    <TextBox x:Name="lbxAttributes" HorizontalAlignment="Left" Height="56" Margin="0,215,0,0" VerticalAlignment="Top" Width="260" Grid.Column="1"/>
                </Grid>
            </TabItem>

            <TabItem Header="Attribute">
                <Grid>
                    <GroupBox Header="Attribute" HorizontalAlignment="Center" Height="440" Margin="10" VerticalAlignment="Center" Width="482"></GroupBox>
                    <Label x:Name="lblAttributeID" Content="Attribute ID:" HorizontalAlignment="Left" Height="30" Margin="31,40,0,397"/>
                    <TextBox x:Name="txtAttributeID" HorizontalAlignment="Left" Height="30" Margin="118,40,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="251"/>
                    <DataGrid x:Name="dgdAttributes" HorizontalAlignment="Left" Height="156" Margin="31,277,0,0" VerticalAlignment="Top" Width="438" Loaded="Attrib_Loaded" SelectionChanged="dgdAttributes_SelectionChanged"/>
                    <CheckBox x:Name="chbxADisable" Content="Disable User" HorizontalAlignment="Left" Margin="118,180,0,0" VerticalAlignment="Top"/>
                    <Button x:Name="btnAddAttribute" Content="AddAttrib" HorizontalAlignment="Left" Margin="382,40,0,0" VerticalAlignment="Top" Height="30" Width="87" Click="btnAddAttribute_Click"/>
                    <Button x:Name="btnSaveAttribute" Content="Save" HorizontalAlignment="Left" Margin="404,75,0,0" VerticalAlignment="Top" Height="30" Width="65" Click="btnSaveAttribute_Click"/>
                    <Button x:Name="btnDeleteAttribute" Content="Delete" HorizontalAlignment="Left" Margin="404,110,0,0" VerticalAlignment="Top" Height="30" Width="65" Click="btnDeleteAttribute_Click" />
                    <Button x:Name="btnAttributecancel" Content="Cancel" HorizontalAlignment="Left" Margin="404,145,0,0" VerticalAlignment="Top" Height="30" Width="65"/>
                    <TextBox x:Name="txtAttributesearch" HorizontalAlignment="Left" Height="30" Margin="143,242,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="226"/>
                    <Label x:Name="lblAttributesearch"  Content="Search Attributes:" HorizontalAlignment="Left" Margin="31,242,0,0" VerticalAlignment="Top" Width="105"/>
                    <Button x:Name="btnAttributesearch" Content="Search" HorizontalAlignment="Left" Margin="394,238,0,0" VerticalAlignment="Top" Height="30" Width="75" />
                    <Label x:Name="lblAttributeName" Content="Name:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="31,75,0,355"/>
                    <TextBox x:Name="txtAttributeName" HorizontalAlignment="Left" Height="30" Margin="118,75,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="251"/>
                    <Label x:Name="lblAttributeDataType" Content="Data type:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="31,110,0,320"/>
                    <TextBox x:Name="txtAttributeType" HorizontalAlignment="Left" Height="30" Margin="118,110,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="251"/>
                    <Label x:Name="lblAttributeDescription" Content="Description:" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Height="30" Margin="31,145,0,285"/>
                    <TextBox x:Name="txtAttributeDescription" HorizontalAlignment="Left" Height="30" Margin="118,145,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="251"/>
                </Grid>
            </TabItem>
            <TabItem Header="UserGroup">
                <Grid>                    
                    <GroupBox Header="UserGroup" HorizontalAlignment="Center" Height="440" Margin="10" VerticalAlignment="Center" Width="482"></GroupBox>
                    <DataGrid x:Name="dgdUserGroup" HorizontalAlignment="Left" Height="340" AutoGenerateColumns="False" Margin="31,57,0,0" VerticalAlignment="Top" Width="438" Loaded="UserGroup_Loaded">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=UserName}" Width="120" Header="UserName" />
                            <DataGridTextColumn Binding="{Binding Path=GroupName}" Width="120" Header="Group Name" />

                            <DataGridTextColumn Binding="{Binding Path=UsrGrpDisabled}" Width="*" Header="Disabled" />
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>

            <TabItem Header="GroupAttribute">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="99*"/>
                        <ColumnDefinition Width="8*"/>
                        <ColumnDefinition Width="9*"/>
                        <ColumnDefinition Width="13*"/>
                        <ColumnDefinition Width="373*"/>
                    </Grid.ColumnDefinitions>
                    <GroupBox Header="Group Attribute" HorizontalAlignment="Center" Height="440" Margin="10" VerticalAlignment="Center" Width="482" Grid.ColumnSpan="5"></GroupBox>
                    <DataGrid x:Name="dgdGroupAttrib" HorizontalAlignment="Left" Height="340" AutoGenerateColumns="False" Margin="31,57,0,0" VerticalAlignment="Top" Width="438"  Loaded="GroupAttrib_Loaded" Grid.ColumnSpan="5">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=GroupName}" Width="120" Header="Group Name" />
                            <DataGridTextColumn Binding="{Binding Path=AttribName}" Width="120" Header="Attribute Name" />
                            <DataGridTextColumn Binding="{Binding Path=Values}" Width="*" Header="Value" />
                            <DataGridTextColumn Binding="{Binding Path=GrpAttrbDisabled}" Width="*" Header="Disabled" />
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>

        </TabControl>
    </Grid>
</Window>
